<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class DistributiorWithdrawal extends Model
{
    public function getWithdrawalAmountAttribute($value)
    {
        return $value / 100;
    }
    
    public function setWithdrawalAmountAttribute($value)
    {
        $this->attributes['withdrawal_amount'] = $value * 100;
    }
    
    // 关联分销员表
	public function distributor()
	{
		return $this->belongsTo(Distributor::class, 'distributors_id');
	}
	
	// 关联银行表
	public function bank()
	{
		return $this->belongsTo(Bank::class);
	}
}
